package com.dhnsoft.game;

/**
 * @Description
 * @ClassName LevelInfo
 * @Author dhn
 * @date 2020.11.21 16:56
 */
//用来管理当前关卡的信息
public class LevelInfo {
    //构造方法私有化
    private LevelInfo(){

    }
    //定义静态的本类类型的变量,来指向唯一的实例
    private static LevelInfo instance;
    //所有的访问该类的唯一实例，都是通过该方法
    public static LevelInfo getInstance(){
        if(instance==null){
            instance=new LevelInfo();
        }
        return instance;
    }
    //关卡编号
    private int level;
    //关卡的敌人的数量
    private int enemyCount;
    //通关要求的时长,-1意味着不限时
    private int crossTime = -1;
    //敌人类型信息
    private int[] enemyType;
    //游戏难度
    private int levelType;

    public int[] getEnemyType() {
        return enemyType;
    }

    public void setEnemyType(int[] enemyType) {
        this.enemyType = enemyType;
    }

    public int getLevelType() {
        return levelType<=0?1:levelType;
    }

    public void setLevelType(int levelType) {
        this.levelType = levelType;
    }

    public static void setInstance(LevelInfo instance) {
        LevelInfo.instance = instance;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getEnemyCount() {
        return enemyCount;
    }

    public void setEnemyCount(int enemyCount) {
        this.enemyCount = enemyCount;
    }
}
